<template>
  <el-tabs style="height: 100%;"  v-model="editableTabsValue">
    <el-tab-pane label="叠瓦焊机" name="叠瓦焊机"><Diewa :Diewa="toSonDiewa"></Diewa></el-tab-pane>
    <el-tab-pane label="MBB" name="MBB"><Mbb :Mbb="toSonMbb"></Mbb></el-tab-pane>
  </el-tabs>
</template>

<script setup name="MainTrend">
  import Diewa from "./diewa.vue"
  import Mbb from "./mbb.vue"

  const editableTabsValue = ref('叠瓦焊机')
  const toSonMbb = reactive({})
  const toSonDiewa = reactive({})

  onActivated(() => {
    let { tabName, selectedEpt, dataTime, machineId } = history?.state
    editableTabsValue.value = tabName
    if(tabName && selectedEpt && dataTime){
      if(tabName === 'MBB'){
        toSonMbb.selectedEpt = selectedEpt
        toSonMbb.dataTime = dataTime
        toSonMbb.machineId = machineId
      } else {
        toSonDiewa.selectedEpt = selectedEpt
        toSonDiewa.dataTime = dataTime
        toSonDiewa.machineId = machineId
      }
    }
  })
</script>
<style lang="less" scoped>
:deep(.el-tabs__header){
  margin-left: 20px;
}
</style>
